<template>
  App组件:
  <button @click="get">取出数据</button>
  <hr>
  <Zi3></Zi3>
  <Zi4></Zi4>
</template>
<script lang="ts" setup>

import Zi3 from './components/Zi3.vue'
import Zi4 from './components/Zi4.vue'

const get = () => {
  const userData = sessionStorage.getItem('user');
  if (userData !== null) {
    try {
      console.log(JSON.parse(userData));
    } catch (error) {
      console.error('解析用户数据失败:', error);
    }
  } else {
    console.log('sessionStorage中没有用户数据');
  }
}

</script>
<style scoped>

</style>